import { Controller, Get, Headers, Body, Patch, Param, Delete, HttpCode, Query, UseGuards } from '@nestjs/common';
import { CategoryService } from './category.service';
import { AuthGuard } from '@nestjs/passport';
import { ApiResponse, ApiOperation, ApiTags } from '@nestjs/swagger';
import { GetCategoryDto } from 'src/modules/admin/category/dto/category.dto';
import { CategoryResult } from 'src/modules/admin/category/entities/category.entity';
@ApiTags('category')
@Controller('home/category')
export class CategoryController {
  constructor(private readonly categoryService: CategoryService) { }
  /** 分类 */
  @HttpCode(200)
  @Get('/getCategory')
  @ApiResponse({
    status: 200,
    description: '分类列表',
    type: CategoryResult,
  })
  @ApiOperation({
    tags: ['获取分类'],
    summary: '获取分类',
    operationId: 'getCategory',
  })
  getCategory(@Query() params: GetCategoryDto, @Headers('lang') lang: string) {
    return this.categoryService.getCategory(params, lang);
  }
}
